<template>
  <div v-loading="showLoading">
    <div>
      <div class="fx">
        <div class="block f5bg">
          <div class="block-left">失信被执行条数：</div>
          <div
            class="block-right"
            v-html-no="{ action: gssfInfo.enterpriseDishonestSum }"
          ></div>
        </div>
        <div class="block f5bg">
          <div class="block-left">被执行条数：</div>
          <div
            class="block-right"
            v-html-no="{ action: gssfInfo.executedPersonSum }"
          ></div>
        </div>
      </div>
      <div class="fx">
        <div class="block">
          <div class="block-left">法院公告条数：</div>
          <div
            class="block-right"
            v-html-no="{ action: gssfInfo.courtNoticeSum }"
          ></div>
        </div>
        <div class="block">
          <div class="block-left">判决文书条数：</div>
          <div
            class="block-right"
            v-html-no="{ action: gssfInfo.enterpriseCaseSum }"
          ></div>
        </div>
      </div>
      <div class="fx">
        <div class="block f5bg">
          <div class="block-left">总涉案金额：</div>
          <div
            class="block-right"
            v-html-no="{ action: gssfInfo.subjectAmount }"
          ></div>
        </div>
        <div class="block f5bg">
          <div class="block-left">近6月是否有法人变更：</div>
          <div
            class="block-right"
            v-html-no="{ action: `${gssfInfo.changeStatus ? '是' : '否'}` }"
          ></div>
        </div>
      </div>
    </div>
    <div class="canpanyer-box" style="margin-top: 20px">
      <div class="title-msg">
        工商变更信息
      </div>
      <div class="canpanyer-box-msg">
        <el-table
          :data="tableData1"
          border
          style="width: 100%; margin-top: 20px"
        >
          <el-table-column align="center" prop="name" label="变更项目">
          </el-table-column>
          <el-table-column align="center" prop="changeDate" label="变更日期">
          </el-table-column>
          <el-table-column
            align="center"
            prop="beforeContent"
            label="变更前内容"
          >
          </el-table-column>
          <el-table-column
            align="center"
            prop="affterContent"
            label="变更后内容"
          >
          </el-table-column>
        </el-table>
      </div>
    </div>
    <div class="canpanyer-box" style="margin-top: 20px">
      <div class="title-msg">
        判决文书
      </div>
      <div class="canpanyer-box-msg">
        <el-table
          :data="tableData2"
          border
          style="width: 100%; margin-top: 20px"
        >
          <el-table-column align="center" prop="name" label="文书标题">
          </el-table-column>
          <el-table-column align="center" label="案件类型">
            <template slot-scope="scope">
              <span>{{ scope.row.caseType | typeFlter }}</span>
            </template>
          </el-table-column>
          <el-table-column align="center" prop="roleType" label="案件身份">
          </el-table-column>
          <el-table-column align="center" prop="judgeDate" label="案件日期">
          </el-table-column>
        </el-table>
      </div>
    </div>
  </div>
</template>
<script>
import { getReportJudicial } from "@/api/report";
export default {
  name: "gssfInfo",
  props: {
    detailInfo: {
      type: Object,
      default: () => {}
    }
  },
  filters: {
    // (ms:民事 xs:刑事 xz:行政 pc:赔偿 zx:执行 gx: 管辖案件 gsx：国际司法协助案件qsx：区际司法协助案件 other：其他
    typeFlter(type) {
      const objMap = {
        ms: "民事",
        xs: "刑事",
        xz: "行政",
        pc: "赔偿",
        zx: "执行",
        gx: "管辖案件",
        gsx: "国际司法协助案件",
        qsx: "区际司法协助案件",
        other: "其他"
      };
      return objMap[type];
    }
  },
  data() {
    return {
      gssfInfo: {},
      showLoading: false,
      tableData1: [], // 工商变更信息
      tableData2: [] // 判决文书
    };
  },
  created() {
    this.getInfo();
  },
  mounted() {},
  methods: {
    getInfo() {
      this.showLoading = true;
      let params = {
        enterpriseId: this.detailInfo.enterpriseId,
        createTime: this.detailInfo.createTime
      };
      getReportJudicial(params)
        .then(res => {
          this.gssfInfo = res.data;
          this.tableData1 = res.data.enterpriseChangeList;
          this.tableData2 = res.data.qccEnterpriseCaseList;
          this.showLoading = false;
        })
        .finally(() => {
          this.showLoading = false;
        });
    }
  }
};
</script>

<style scoped lang="scss">
.f5bg {
  background: #f5f5f5;
}
.fx {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  .block {
    width: 48%;
    display: flex;
    align-items: center;
    max-height: 60px;
    padding: 18px 0;

    //line-height: 56px;
    .block-left {
      display: inline-block;
      //display: flex;
      text-align: right;
      width: 60%;
      white-space: nowrap;
      color: #999;
    }
    .block-right {
      display: inline-block;
      //display: flex;
      line-height: 18px;
      color: #222;
      width: 38%;
    }
  }
}
.title-msg {
  font-size: 18px;
  font-weight: 500;
  color: #222222;
}
</style>
